package com.hkemm.students;

public class English extends Student{
    private double speech;      //演讲分数，50%
    private double final_term;  //期末分数，25%
    private double mid_term;    //期中分数，25%


    public English(int stu_number, String name, String sex, int age) {
        super(stu_number, name, sex, age);
    }

    public double getSpeech() {
        return speech;
    }

    public void setSpeech(double speech) {
        this.speech = speech;
    }

    public double getFinal_term() {
        return final_term;
    }

    public void setFinal_term(double final_term) {
        this.final_term = final_term;
    }

    public double getMid_term() {
        return mid_term;
    }

    public void setMid_term(double mid_term) {
        this.mid_term = mid_term;
    }

    @Override
    public void showGrade() {
        double n = 0;   //存储最终分数
        //最终成绩计算方法
        n = this.speech*0.5 + this.mid_term*0.25 + this.final_term*0.25;
        n = Math.round(n*100)/100.0;    //保留两位小数
        System.out.println("学号:" + getStu_number() + "\t姓名:" + getName() + "\t性别:" + getSex() +
                "\t年龄:" + getAge() + "\t综合成绩:" + n);
    }
}
